import request from '@/utils/request'

export function getEmployeeSimple() {
  return request({
    method: 'get',
    url: '/sys/user/simple'
  })
}
export function getEmployeesList(params) {
  return request({
    method: 'get',
    url: 'sys/user',
    params
  })
}

export function delEmployeesAPI(id) {
  return request({
    method: 'delete',
    url: 'sys/user/' + id
  })
}
// 新增员工
export function addEmployeeAPI(data) {
  return request({
    method: 'post',
    url: 'sys/user',
    data
  })
}
// 批量导入员工
export function importEmployeesAPI(data) {
  return request({
    method: 'POST',
    url: '/sys/user/batch',
    data
  })
}
// /employees/{id}/personalInfo
// 根据id查询员工信息
export function getEmployeeDetailAPI(id) {
  return request({
    method: 'get',
    url: `/sys/user/${id}`
  })
}

// 保存员工基本信息
export function updateEmployeeDetailAPI(data) {
  return request({
    method: 'put',
    url: `/sys/user/${data.id}`,
    data
  })
}

